package com.smsc.headend.task.engine.mapper.provider;

import com.smsc.headend.task.engine.po.LogScheduleTaskCountPo;

public class LogScheduleTaskProvider {

    public String optimisticUpdate(LogScheduleTaskCountPo po) {
        StringBuilder sb = new StringBuilder("UPDATE LOG_SCHEDULE_TASK SET WAITING_NUM = #{waitingNumber}, PROCESS_NUM = #{processingNumber}, SUCCESS_NUM = #{completeNumber}, VERSION = VERSION + 1");
        if (po.getTv() != null) {
            sb.append(", TV_END=#{tv} ");
        }
        sb.append(" WHERE MESSAGE_ID = #{messageId} AND VERSION = #{version}");
        return sb.toString();
    }
}
